/*
//
//              INTEL CORPORATION PROPRIETARY INFORMATION
//  This software is supplied under the terms of a license  agreement or
//  nondisclosure agreement with Intel Corporation and may not be copied
//  or disclosed except in  accordance  with the terms of that agreement.
//    Copyright (c) 2007-2008 Intel Corporation. All Rights Reserved.
//
//
*/

#ifndef __UMC_AVS_PROCESSING_UNIT_H
#define __UMC_AVS_PROCESSING_UNIT_H

#include "umc_avs_pic.h"
#include "umc_avs_list.h"

namespace UMC
{

// this is just an interface class

// forward declaration of used classes
class Mutex;
class AVSFrame;
class BaseCodecParams;

class AVSProcessingUnit
{
public:
    // Constructor
    AVSProcessingUnit(void);
    // Destructor
    virtual
    ~AVSProcessingUnit(void) = 0;

    // Initialize the performer
    virtual
    Status Init(Mutex *pGuard);
    virtual
    Status Init(Mutex *pGuard, BaseCodecParams*);

    // Let the performer find the job
    virtual
    bool LoadJob(AVSListElement<AVSFrame> *pFrameList) = 0;

    // Main working function
    virtual
    Status DoJob(void) = 0;

    // Error handling function
    virtual
    Status HandleError(void);

    Ipp32s m_threadNumber;                                      // (Ipp32s) number of owning thread

protected:
    // Set the job done
    virtual
    void UnloadJob(void) = 0;

    Mutex *m_pGuard;                                            // (Mutex &) the sync object
};

} // namespace UMC

#endif // __UMC_AVS_PROCESSING_UNIT_H
